<?php
/**
 * 控制台
 *
 * 
 *
 *
 * @copyright  Copyright (c) 2010-2015 NcPHP Inc. (http://www.ncphp.com)
 * @license    http://www.ncphp.com
 * @link       http://www.ncphp.com
 * @since      File available since Release v1.1
 */
defined('InNcPHP') or exit('Access Invalid!');

class dashboardControl extends SystemControl{
	public function __construct(){
		parent::__construct();
		Language::read('dashboard');
	}

	// 欢迎页面
	public function welcome_oldOp(){
		$model_admin = Model('admin');
		$tmp = $this->getAdminInfo();
		$condition['admin_id'] = $tmp['id'];
		$admin_info = $model_admin->getAdminInfo($condition);
		$admin_info['admin_login_time'] = date('Y-m-d H:i:s',($admin_info['admin_login_time'] == '' ? time() : $admin_info['admin_login_time']));
		$statistics['os'] = PHP_OS;
		$statistics['web_server'] = $_SERVER['SERVER_SOFTWARE'];
		$statistics['php_version'] = PHP_VERSION;
		$statistics['sql_version'] = Db::getServerInfo();
		Tpl::output('statistics',$statistics);
		Tpl::output('admin_info',$admin_info);

        $permission_hotel = $this->check_by_act_permission("hotel","index_new");
        echo "结果：".json_encode($permission_hotel);
        exit();

        //酒店审核订单
        if($admin_info['merchant_id']){
            $tmp_condition = array('order_type'=>1,'merchant_id'=>$admin_info['merchant_id']);
            $tmp_condition['order_status'] = 20;  $tmp_condition['if_examine'] = 0;
            $hotel_un_operation = Model("order")->getOrderCount($tmp_condition);
            $hotel_order_info = Model("order")->getOrderInfo($tmp_condition);
            $order_hotel_info = Model("order_hotel")->getOrderHotelInfo(array('order_id'=>$hotel_order_info['order_id']));
            Tpl::output('order_hotel_info',$order_hotel_info);
            Tpl::output('hotel_order_info',$hotel_order_info);
            Tpl::output('hotel_un_operation',$hotel_un_operation);
        }




        $start_time =  date("Y-m-d H:i:s",mktime(0, 0 , 0,date("m"),date("d"),date("Y")));
        $end_time =  date("Y-m-d H:i:s",mktime(23,59,59,date("m") ,date("d"),date("Y")));

        $start_time = strtotime($start_time);
        $end_time = strtotime($end_time);
        //酒店订单 10未支付，20未核销，21已核销，30已取消,31退款中,32已退款
        //order_type  (1为酒店 2 为门票 3为美食 4旅行社)
        $condition = array();
        if($admin_info['merchant_id']){
            $condition['merchant_id'] = $admin_info['merchant_id'];
        }

        $condition['order_type'] = 1;
        $hotel_order = Model("order")->get_order_status_count($condition);
        $hotel_order['total_count'] = $hotel_order['pay_count']+$hotel_order['shoping_count']+$hotel_order['complete_count'];
        $totay_condition = $condition;
        $totay_condition['order_status'] = array('in','10,20,21');
        $totay_condition['add_time'] = array('between',array($start_time,$end_time));
        $today_count = Model("order")->getOrderCount($totay_condition);
        $hotel_order['today_count'] =$today_count;

//        $condition['order_status'] = array('in','10,20,21');
//        $hotel_total_count = Model("order")->getOrderCount($condition);
//        $condition['order_status'] = 10;
//        $hotel_pay_count = Model("order")->getOrderCount($condition);
//        $condition['order_status'] = 20;
//        $hotel_shoping_count = Model("order")->getOrderCount($condition);
//        $condition['order_status'] = 31;
//        $hotel_refund_count = Model("order")->getOrderCount($condition);
//        $condition['order_status'] = array('in','10,20,21');
//        $hotel_order = array(
//            'total_count'=>$hotel_total_count, 'today_count'=>$hotel_today_count,
//            'pay_count'=>$hotel_pay_count, 'shoping_count'=>$hotel_shoping_count,
//            'refund_count'=>$hotel_refund_count,
//        );
        Tpl::output('hotel_order',$hotel_order);


        //门票订单
        $condition['order_type'] = 2;
        $ticket_order = Model("order")->get_order_status_count($condition);
        $ticket_order['total_count'] = $ticket_order['pay_count']+$ticket_order['shoping_count']+$ticket_order['complete_count'];
        $totay_condition = $condition;
        $totay_condition['order_status'] = array('in','10,20,21');
        $totay_condition['add_time'] = array('between',array($start_time,$end_time));
        $today_count = Model("order")->getOrderCount($totay_condition);
        $ticket_order['today_count'] =$today_count;


//        $condition['order_status'] = array('in','10,20,21');
//        $today_count = Model("order")->getOrderCount($condition);
//        unset($condition['add_time']);
//        $total_count = Model("order")->getOrderCount($condition);
//        $condition['order_status'] = 10;
//        $pay_count = Model("order")->getOrderCount($condition);
//        $condition['order_status'] = 20;
//        $shoping_count = Model("order")->getOrderCount($condition);
//        $condition['order_status'] = 31;
//        $refund_count = Model("order")->getOrderCount($condition);
//        $ticket_order = array(
//            'total_count'=>$total_count, 'today_count'=>$today_count,
//            'pay_count'=>$pay_count, 'shoping_count'=>$shoping_count,
//            'refund_count'=>$refund_count,
//        );
        Tpl::output('ticket_order',$ticket_order);


        //美食订单
        $condition['order_type'] = 3;
        $food_order = Model("order")->get_order_status_count($condition);
        $food_order['total_count'] = $food_order['pay_count']+$food_order['shoping_count']+$food_order['complete_count'];
        $totay_condition = $condition;
        $condition['order_status'] = array('in','10,20,21');
        $totay_condition['add_time'] = array('between',array($start_time,$end_time));
        $today_count = Model("order")->getOrderCount($totay_condition);
        $food_order['today_count'] =$today_count;


//        $condition['order_status'] = array('in','10,20,21');
//        $condition['add_time'] = array('between',array($start_time,$end_time));
//        $today_count = Model("order")->getOrderCount($condition);
//        unset($condition['add_time']);
//        $total_count = Model("order")->getOrderCount($condition);
//        $condition['order_status'] = 10;
//        $pay_count = Model("order")->getOrderCount($condition);
//        $condition['order_status'] = 20;
//        $shoping_count = Model("order")->getOrderCount($condition);
//        $condition['order_status'] = 31;
//        $refund_count = Model("order")->getOrderCount($condition);
//        $food_order = array(
//            'total_count'=>$total_count, 'today_count'=>$today_count,
//            'pay_count'=>$pay_count, 'shoping_count'=>$shoping_count,
//            'refund_count'=>$refund_count,
//        );
        Tpl::output('food_order',$food_order);


        //旅行社订单
        $condition['order_type'] = 4;
        $itinerary_order = Model("order")->get_order_status_count($condition);
        $itinerary_order['total_count'] = $itinerary_order['pay_count']+$itinerary_order['shoping_count']+$itinerary_order['complete_count'];
        $totay_condition = $condition;
        $condition['order_status'] = array('in','10,20,21');
        $totay_condition['add_time'] = array('between',array($start_time,$end_time));
        $today_count = Model("order")->getOrderCount($totay_condition);
        $itinerary_order['today_count'] =$today_count;


//        $condition['order_status'] = array('in','10,20,21');
//        $condition['add_time'] = array('between',array($start_time,$end_time));
//        $today_count = Model("order")->getOrderCount($condition);
//        unset($condition['add_time']);
//        $total_count = Model("order")->getOrderCount($condition);
//        $condition['order_status'] = 10;
//        $pay_count = Model("order")->getOrderCount($condition);
//        $condition['order_status'] = 20;
//        $shoping_count = Model("order")->getOrderCount($condition);
//        $condition['order_status'] = 31;
//        $refund_count = Model("order")->getOrderCount($condition);
//        $itinerary_order = array(
//            'total_count'=>$total_count, 'today_count'=>$today_count,
//            'pay_count'=>$pay_count, 'shoping_count'=>$shoping_count,
//            'refund_count'=>$refund_count,
//        );
//        unset($condition['order_type']); unset($condition['order_status']);
        Tpl::output('itinerary_order',$itinerary_order);


        //门票管理
        unset($condition['order_type']); unset($condition['order_status']);
        $ticket_count = Model("ticket")->get_status_count($condition);
        $ticket_count['total_count'] = $ticket_count['sale_count']+$ticket_count['un_sale_count'];
        $today_condition['tk_add_time']=array('between',array($start_time,$end_time));
        $today_count = Model("ticket")->getTicketCount($today_condition);
        $ticket_count['today_count'] = $today_count;
        unset($condition['tk_add_time']);
//        unset($condition['tk_add_time']);
//        $condition['tk_status'] = 1;
//        $sale_count = Model("ticket")->getTicketCount($condition);
//        $condition['tk_status'] = 0;
//        $un_sale_count = Model("ticket")->getTicketCount($condition);
//        $ticket_count = array(
//            'total_count'=>$total_count, 'today_count'=>$today_count,
//            'sale_count'=>$sale_count, 'un_sale_count'=>$un_sale_count,
//        );

        Tpl::output('ticket_count',$ticket_count);


        //酒店管理
        $hotel_count = Model("hotel")->get_status_count($condition);
        $hotel_count['total_count'] = $hotel_count['sale_count']+$hotel_count['un_sale_count'];
        $today_condition['ht_add_time']=array('between',array($start_time,$end_time));
        $today_count = Model("hotel")->getHotelCount($today_condition);
        $hotel_count['today_count'] = $today_count;
        unset($condition['ht_add_time']);

//        $total_count = Model("hotel")->getHotelCount($condition);
//        $condition['ht_add_time'] = array('between',array($start_time,$end_time));
//        $today_count = Model("hotel")->getHotelCount($condition);
//        unset($condition['ht_add_time']);
//        $condition['ht_status'] = 1;
//        $sale_count = Model("hotel")->getHotelCount($condition);
//        $condition['ht_status'] = 0;
//        $un_sale_count = Model("hotel")->getHotelCount($condition);
//        $hotel_count = array(
//            'total_count'=>$total_count, 'today_count'=>$today_count,
//            'sale_count'=>$sale_count, 'un_sale_count'=>$un_sale_count,
//        );
//        unset($condition['ht_status']);
        Tpl::output('hotel_count',$hotel_count);


        //旅行社管理
        $itinerary_count = Model("itinerary")->get_status_count($condition);
        $itinerary_count['total_count'] = $itinerary_count['sale_count']+$itinerary_count['un_sale_count'];
        $today_condition['ir_add_time']=array('between',array($start_time,$end_time));
        $today_count = Model("hotel")->getHotelCount($today_condition);
        $itinerary_count['today_count'] = $today_count;
        unset($condition['ir_add_time']);

//        $total_count = Model("itinerary")->getItineraryCount($condition);
//        $condition['ir_add_time'] = array('between',array($start_time,$end_time));
//        $today_count = Model("itinerary")->getItineraryCount($condition);
//        unset($condition['ir_add_time']);
//        $condition['ir_status'] = 1;
//        $sale_count = Model("itinerary")->getItineraryCount($condition);
//        $condition['ir_status'] = 0;
//        $un_sale_count = Model("itinerary")->getItineraryCount($condition);
//        $itinerary_count = array(
//            'total_count'=>$total_count, 'today_count'=>$today_count,
//            'sale_count'=>$sale_count, 'un_sale_count'=>$un_sale_count,
//        );
        unset($condition['ir_status']);
        Tpl::output('itinerary_count',$itinerary_count);

        //美食管理
        $food_count = Model("food")->get_status_count($condition);
        $food_count['total_count'] = $food_count['sale_count']+$food_count['un_sale_count'];
        $today_condition['fd_add_time']=array('between',array($start_time,$end_time));
        $today_count = Model("hotel")->getHotelCount($today_condition);
        $food_count['today_count'] = $today_count;
        unset($condition['fd_add_time']);


//        $total_count = Model("food")->getFoodCount($condition);
//        $condition['fd_add_time'] = array('between',array($start_time,$end_time));
//        $today_count = Model("food")->getFoodCount($condition);
//        unset($condition['fd_add_time']);
//        $condition['fd_status'] = 1;
//        $sale_count = Model("food")->getFoodCount($condition);
//        $condition['fd_status'] = 0;
//        $un_sale_count = Model("food")->getFoodCount($condition);
//        $food_count = array(
//            'total_count'=>$total_count, 'today_count'=>$today_count,
//            'sale_count'=>$sale_count, 'un_sale_count'=>$un_sale_count,
//        );
        unset($condition['fd_status']);
        Tpl::output('food_count',$food_count);


        // 运营
        if(empty($admin_info['merchant_id'])){
            //提现
            $pd_cash_model = Model('pd_cash');
            $pd_cash_count = $pd_cash_model->getPd_cashCount(array('pdc_status'=>0));
            //商家审核
            $member_merchant = Model('member_merchant');
            $merchant_count = $member_merchant->getMerchantCount(array('mc_status'=>0));
            Tpl::output('admin_count',array('merchant_count'=>$merchant_count,'pd_cash_count'=>$pd_cash_count));
        }


		Tpl::showpage('welcome');
	}



    // 欢迎页面
    public function welcomeOp(){
        $model_admin = Model('admin');
        $tmp = $this->getAdminInfo();
        $condition['admin_id'] = $tmp['id'];
        $admin_info = $model_admin->getAdminInfo($condition);
        $admin_info['admin_login_time'] = date('Y-m-d H:i:s',($admin_info['admin_login_time'] == '' ? time() : $admin_info['admin_login_time']));
        $statistics['os'] = PHP_OS;
        $statistics['web_server'] = $_SERVER['SERVER_SOFTWARE'];
        $statistics['php_version'] = PHP_VERSION;
        $statistics['sql_version'] = Db::getServerInfo();
        Tpl::output('statistics',$statistics);
        Tpl::output('admin_info',$admin_info);
        $my_permission = $this->check_by_act_permission();
        Tpl::output('my_permission',$my_permission);
        $start_time =  date("Y-m-d H:i:s",mktime(0, 0 , 0,date("m"),date("d"),date("Y")));
        $end_time =  date("Y-m-d H:i:s",mktime(23,59,59,date("m") ,date("d"),date("Y")));
        $start_time = strtotime($start_time);
        $end_time = strtotime($end_time);
        $condition = array();
        if($admin_info['merchant_id']){
            $condition['merchant_id'] = $admin_info['merchant_id'];
        }
        //酒店订单 10未支付，20未核销，21已核销，30已取消,31退款中,32已退款
        //order_type  (1为酒店 2 为门票 3为美食 4旅行社)
        $sp = $this->admin_info['sp'];
        Tpl::output('super',$sp);

        //酒店审核订单
        if ($this->admin_info['sp'] == 1||in_array("index.hotel",$my_permission)){
            if($admin_info['merchant_id']){
                $tmp_condition = array('order_type'=>1,'merchant_id'=>$admin_info['merchant_id']);
                $tmp_condition['order_status'] = 20;  $tmp_condition['if_examine'] = 0;
                $hotel_un_operation = Model("order")->getOrderCount($tmp_condition);
                $hotel_order_info = Model("order")->getOrderInfo($tmp_condition,'*','add_time desc');
                $order_hotel_info = Model("order_hotel")->getOrderHotelInfo(array('order_id'=>$hotel_order_info['order_id']));
                Tpl::output('order_hotel_info',$order_hotel_info);
                Tpl::output('hotel_order_info',$hotel_order_info);
                Tpl::output('hotel_un_operation',$hotel_un_operation);
            }
            $condition['order_type'] = 1;
            $hotel_order = Model("order")->get_order_status_count($condition);
            $hotel_order['total_count'] = $hotel_order['pay_count']+$hotel_order['shoping_count']+$hotel_order['complete_count'];
            $totay_condition = $condition;
            $totay_condition['order_status'] = array('in','10,20,21');
            $totay_condition['add_time'] = array('between',array($start_time,$end_time));
            $today_count = Model("order")->getOrderCount($totay_condition);
            $hotel_order['today_count'] =$today_count;
            Tpl::output('hotel_order',$hotel_order);
            unset($condition['order_type']); unset($totay_condition['order_status']);unset($totay_condition['add_time']);

            //酒店管理
            $hotel_count = Model("hotel")->get_status_count($condition);
            $hotel_count['total_count'] = $hotel_count['sale_count']+$hotel_count['un_sale_count'];
            $today_condition = $condition;
            $today_condition['ht_add_time']=array('between',array($start_time,$end_time));
            $today_count = Model("hotel")->getHotelCount($today_condition);
            $hotel_count['today_count'] = $today_count;
            unset($today_condition['ht_add_time']);
            Tpl::output('hotel_count',$hotel_count);
        };

        //门票订单
        if ($this->admin_info['sp'] == 1||in_array("index.ticket",$my_permission)){
            $condition['order_type'] = 2;
            $ticket_order = Model("order")->get_order_status_count($condition);
            $ticket_order['total_count'] = $ticket_order['pay_count']+$ticket_order['shoping_count']+$ticket_order['complete_count'];
            $totay_condition = $condition;
            $totay_condition['order_status'] = array('in','10,20,21');
            $totay_condition['add_time'] = array('between',array($start_time,$end_time));
            $today_count = Model("order")->getOrderCount($totay_condition);
            $ticket_order['today_count'] =$today_count;
            Tpl::output('ticket_order',$ticket_order);
            unset($condition['order_type']); unset($totay_condition['add_time']);unset($totay_condition['order_status']);

            //门票管理
            $ticket_count = Model("ticket")->get_status_count($condition);
            $ticket_count['total_count'] = $ticket_count['sale_count']+$ticket_count['un_sale_count'];
            $today_condition = $condition;
            $today_condition['tk_add_time']=array('between',array($start_time,$end_time));
            $today_count = Model("ticket")->getTicketCount($today_condition);
            $ticket_count['today_count'] = $today_count;
            unset($today_condition['tk_add_time']);
            Tpl::output('ticket_count',$ticket_count);
        }

        //旅行社订单
        if ($this->admin_info['sp'] == 1||in_array("index.itinerary",$my_permission)){  //旅行社
            $condition['order_type'] = 4;
            $itinerary_order = Model("order")->get_order_status_count($condition);
            $itinerary_order['total_count'] = $itinerary_order['pay_count']+$itinerary_order['shoping_count']+$itinerary_order['complete_count'];
            $totay_condition = $condition;
            $totay_condition['order_status'] = array('in','10,20,21');
            $totay_condition['add_time'] = array('between',array($start_time,$end_time));
            $today_count = Model("order")->getOrderCount($totay_condition);
            $itinerary_order['today_count'] =$today_count;
            Tpl::output('itinerary_order',$itinerary_order);
            unset($condition['order_type']); unset($totay_condition['add_time']);unset($totay_condition['order_status']);

            //旅行社管理
            $itinerary_count = Model("itinerary")->get_status_count($condition);
            $itinerary_count['total_count'] = $itinerary_count['sale_count']+$itinerary_count['un_sale_count'];
            $today_condition = $condition;
            $today_condition['ir_add_time']=array('between',array($start_time,$end_time));
            $today_count = Model("hotel")->getHotelCount($today_condition);
            $itinerary_count['today_count'] = $today_count;
            unset($today_condition['ir_add_time']);
            Tpl::output('itinerary_count',$itinerary_count);
        }


        //美食订单
        if ($this->admin_info['sp'] == 1||in_array("index.food",$my_permission)){  //美食
            $condition['order_type'] = 3;
            $food_order = Model("order")->get_order_status_count($condition);
            $food_order['total_count'] = $food_order['pay_count']+$food_order['shoping_count']+$food_order['complete_count'];
            $totay_condition = $condition;
            $totay_condition['order_status'] = array('in','10,20,21');
            $totay_condition['add_time'] = array('between',array($start_time,$end_time));
            $today_count = Model("order")->getOrderCount($totay_condition);
            $food_order['today_count'] =$today_count;
            Tpl::output('food_order',$food_order);
            unset($condition['order_type']); unset($totay_condition['add_time']);unset($totay_condition['order_status']);

            //美食管理
            $food_count = Model("food")->get_status_count($condition);
            $food_count['total_count'] = $food_count['sale_count']+$food_count['un_sale_count'];
            $today_condition = $condition;
            $today_condition['fd_add_time']=array('between',array($start_time,$end_time));
            $today_count = Model("hotel")->getHotelCount($today_condition);
            $food_count['today_count'] = $today_count;
            unset($today_condition['fd_add_time']);
            Tpl::output('food_count',$food_count);
        }
//        echo "结果：".json_encode($my_permission);
//        exit();
        // 运营
        if(empty($admin_info['merchant_id'])){
            //提现
            $pd_cash_model = Model('pd_cash');
            $pd_cash_count = $pd_cash_model->getPd_cashCount(array('pdc_status'=>0));
            //商家审核
            $member_merchant = Model('member_merchant');
            $merchant_count = $member_merchant->getMerchantCount(array('mc_status'=>0));
            Tpl::output('admin_count',array('merchant_count'=>$merchant_count,'pd_cash_count'=>$pd_cash_count));
        }

        Tpl::showpage('welcome');
    }


    /**
     * 信息提醒
     */
    public function is_remind_messageOp(){
        $tmp = $this->getAdminInfo();
        $condition['admin_id'] = $tmp['id'];
        if($tmp['id']){
            $model_admin = Model('admin');
            $_POST['remind_message']=($_POST['remind_message']=='true')?1:0;
            $rs = $model_admin->updateAdmin($condition,array('remind_message'=>$_POST['remind_message']));
            if($rs){
                die(json_encode(array('tab' => 'success', 'info' => '修改成功')));
            }else{
                die(json_encode(array('tab' => 'error', 'info' => '修改失败')));
            }
        }else{
            die(json_encode(array('tab' => 'error', 'info' => '参数错误')));
        }
    }


    /**
     * 语音提醒
     */
    public function is_remind_voiceOp(){
        $tmp = $this->getAdminInfo();
        $condition['admin_id'] = $tmp['id'];
        if($tmp['id']){
            $model_admin = Model('admin');
            $_POST['remind_voice']=($_POST['remind_voice']=='true')?1:0;
            $rs = $model_admin->updateAdmin($condition,array('remind_voice'=>$_POST['remind_voice']));
            if($rs){
                die(json_encode(array('tab' => 'success', 'info' => '修改成功')));
            }else{
                die(json_encode(array('tab' => 'error', 'info' => '修改失败')));
            }
        }else{
            die(json_encode(array('tab' => 'error', 'info' => '参数错误')));
        }
    }



    /**
     * 提醒
     */
    public function remind_messageOp(){
        $model_admin = Model('admin');
        $redis = new Redis();
        $deploy = C('redis');
        $redis->connect($deploy['master']['host'],$deploy['master']['port']);
        $tmp = $this->getAdminInfo();
        $admin_info = $model_admin->getAdminInfo(array('admin_id'=>$tmp['id']));
        $total_count = 0;
        $order_info = array();
        $remind_message = 0;
        if($admin_info['merchant_id']){
            $condition['merchant_id'] =$admin_info['merchant_id'];
            $start_time = time()-(60*2);
            $end_time =  time();
            $condition['pay_time'] = array('between',array($start_time,$end_time));
            $condition['if_examine'] = '0';
            if($admin_info['remind_voice']){
                $condition['order_status'] = 20;
                $total_count = Model("order")->getOrderCount($condition);
            }
            if($admin_info['remind_message']){
                $condition['order_status'] = 20;
                $order_info = Model("order")->getOrderInfo($condition);
                if(!empty($order_info)){
                    //查询该订单是否已经提醒过
                    if($redis->get($deploy['prefix'].'remindorder-'.$order_info['order_id'])){
                        //已经提醒过的 就不再弹窗了
                        $order_info['pay_time'] = date('Y-m-d H:i:s',$order_info['pay_time']);
                    }else{
                        $remind_message = 1;
                        $order_info['pay_time'] = date('Y-m-d H:i:s',$order_info['pay_time']);
                        $redis->set($deploy['prefix'].'remindorder-'.$order_info['order_id'],'ing',120);
                    }
                }
            }
        }
        die(json_encode(array('tab' => 'success', 'info' => '成功','total_count'=>$total_count,'order_info'=>$order_info,'remind_message'=>$remind_message)));
    }



    /**
     * 刷新酒店订单
     */
    public function refreshOp(){
        $admin_info = $this->getAdminInfo();
        if($admin_info['merchant_id']){
            $tmp_condition = array('order_type'=>1,'merchant_id'=>$admin_info['merchant_id']);
            $tmp_condition['order_status'] = 20;  $tmp_condition['if_examine'] = '0';
            $hotel_un_operation = Model("order")->getOrderCount($tmp_condition);
            $hotel_order_info = Model("order")->getOrderInfo($tmp_condition,'*','add_time desc');
//            $hotel_order_info = Model("order")->getOrderInfo($tmp_condition);
            $order_hotel_info = Model("order_hotel")->getOrderHotelInfo(array('order_id'=>$hotel_order_info['order_id']));
            $data = array(
                'hotel_un_operation'=>$hotel_un_operation,
                'hotel_order_info'=>$hotel_order_info,
                'order_hotel_info'=>$order_hotel_info,
            );
            $model_admin = Model('admin');
            $condition['admin_id'] = $admin_info['id'];
            $admin_info = $model_admin->getAdminInfo($condition);
            die(json_encode(array('tab' => 'success', 'info' => '成功','data'=>$data,'admin'=>$admin_info )));


        }else{
            die(json_encode(array('tab' => 'error', 'info' => '无数据','data'=>array())));
        }
    }





}
